package com.success.application.shop.holder;


import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.Html;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.method.ScrollingMovementMethod;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.loopj.android.http.HttpGet;
import com.success.application.base.BaseHolder;
import com.success.application.myapplication.R;
import com.success.application.shop.bean.HuoDong;

import org.xml.sax.XMLReader;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

import butterknife.Bind;
import cz.msebera.android.httpclient.impl.client.DefaultHttpClient;

import static android.R.id.empty;
import static android.content.ContentValues.TAG;

/**
 * Created by ChrisWong on 2017/1/17.
 */

public class ActivityHolder extends BaseHolder<HuoDong> {
    private HuoDong mhuoDong;
    @Bind(R.id.iv_consult_face)
    ImageView iv_consult_face;
    @Bind(R.id.tv_activity_title)
    TextView tv_activity_title;
    @Bind(R.id.tv_content)
    TextView tv_content;
    @Bind(R.id.tv_activity_time)
    TextView tv_activity_time;
    @Bind(R.id.tv_address)
    TextView tv_address;
    public ActivityHolder(View itemView) {
        super(itemView);
    }
    @Override
    public void bindItem(HuoDong huoDong) {
        mhuoDong = huoDong;
        Glide.with(iv_consult_face.getContext()).load(mhuoDong.getHdzx_hdtb()).into(iv_consult_face);
        tv_activity_title.setText(mhuoDong.getHdzx_zt());
        tv_activity_time.setText(mhuoDong.getHdzx_hdsj());
        tv_address.setText(mhuoDong.getHdzx_hddd());
        tv_content.setText(mhuoDong.getHdzx_bz());
    }
    @Override
    public void onClick(View v) {
//        TestDetailActivity.show(v.getContext(), mConsult);
    }

    @Override
    public boolean onLongClick(View v) {
//        Toast.makeText(v.getContext(),
//                mConsult.getNc()+ "长按事件触发！", Toast.LENGTH_SHORT)
//                .show();
        return true;
    }
}
